//获取id参数
let id = getUrlParams('id')
$.get('/posts/' + id, function (response) {
    console.log(response)
    let html = template('postTpl', response)
    $(".article").html(html)
})

//点赞功能
$(".article").on('click', '#like', function () {
    $.ajax({
        type: 'post',
        url: '/posts/fabulous/' + id,
        success: function () {
            location.reload()
        }
    })
})
